package com.company.project.service.impl;

import com.company.project.dao.ContactMethodMapper;
import com.company.project.model.ContactMethod;
import com.company.project.service.ContactMethodService;
import com.company.project.core.AbstractService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
 * Created by CodeGenerator on 2018/10/08.
 */
@Service
@Transactional
public class ContactMethodServiceImpl extends AbstractService<ContactMethod> implements ContactMethodService {
    @Resource
    private ContactMethodMapper contactMethodMapper;

    @Override
    public List<Map<String, Object>> selectContactMethod() {
        return contactMethodMapper.selectContactMethod();
    }

    @Override
    public Boolean updateContactMethod(ContactMethod contactMethod) {
        boolean flag=false;
        try{
            contactMethodMapper.updateContactMethod(contactMethod);
            flag=true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return flag;
    }

    @Override
    public Boolean insertC(ContactMethod contactMethod) {
        boolean flag=false;
        try{
            contactMethodMapper.insertC(contactMethod);
            flag=true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return flag;
    }

    @Override
    public Boolean delectCon(Integer id) {
        boolean flag=false;
        try{
            contactMethodMapper.delectCon(id);
            flag=true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return flag;
    }
}
